package com.mlk.busPram.controller;

import com.mlk.busPram.po.EngBusParam;
import com.mlk.busPram.service.BusParamService;
import com.mlk.busPram.vo.EngBusParamVO;
import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 业务参数管理
 */
@Controller
@RequestMapping("/eng/busParam")
public class BusParamController {

    @Resource
    private BusParamService busParamService;

    /**
     * 返回首页内容
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "busParam/busParam";
    }


    /**
     * 业务参数展示
     * @return
     */
    @RequestMapping("listPage")
    @ResponseBody
    public Pager listPage(EngBusParamVO vo){
        return this.busParamService.busParamListPage(vo);
    }

    /**
     * 添加
     * @return
     */
    @ResponseBody
    @RequestMapping("add")
    public ServerResponse add(EngBusParam param){
        return this.busParamService.add(param);
    }


    /**
     * 删除
     * @return
     */
    @ResponseBody
    @RequestMapping("del")
    public ServerResponse del(Integer id){
        return this.busParamService.del(id);
    }


    /**
     * 更新
     * @return
     */
    @ResponseBody
    @RequestMapping("update")
    public ServerResponse update(EngBusParam param){
        return this.busParamService.update(param);
    }

}
